﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CacheStrategy
{
    public class RedisKey
    {
        public static string RedisPrefix = System.Configuration.ConfigurationManager.AppSettings["RedisPrefix"].ToString();

        /// <summary>
        /// 所有系统话题
        /// </summary>
        /// <returns></returns>
        public static string AllTopics()
        {
            return RedisPrefix + "ALLTopics";
        }

        /// <summary>
        /// 话题关注记录
        /// </summary>
        /// <param name="SubscriberId"></param>
        /// <returns></returns>
        public static string Follows(int SubscriberTopicId)
        {
            return RedisPrefix + "Follows" + "_" + SubscriberTopicId;
        }

        /// <summary>
        /// 用户发布的话题
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="OpenId"></param>
        /// <returns></returns>
        public static string SubscriberTopic(int Type, string OpenId)
        {
            return RedisPrefix + "SubscriberTopic" + "_" + Type + "_" + OpenId;
        }

        /// <summary>
        /// 个人话题收益全国排名
        /// </summary>
        /// <param name="OpenId"></param>
        /// <returns></returns>
        public static string PersonalProfitRanking(string OpenId)
        {
            return RedisPrefix + "PersonalProfitRanking" + "_" + OpenId;
        }

        /// <summary>
        /// 话题收益全国排名
        /// </summary>
        /// <param name="Type"></param>
        /// <returns></returns>
        public static string SubscriberTopicProfitNationalRank(int Type)
        {
            return RedisPrefix + "SubscriberTopicProfitNationalRank" + "_" + Type;
        }

        /// <summary>
        /// 话题收益好友排名
        /// </summary>
        /// <param name="Type"></param>
        /// <returns></returns>
        public static string SubscriberTopicProfitFriendRank(string OpenId)
        {
            return RedisPrefix + "SubscriberTopicProfitFriendRank" + "_" + OpenId;
        }

        /// <summary>
        /// 用户信息
        /// </summary>
        /// <param name="SubscriberId"></param>
        /// <returns></returns>
        public static string Subscriber(string OpenId)
        {
            return RedisPrefix + "Subscriber" + "_" + OpenId;
        }

        /// <summary>
        /// 话题关注记录
        /// </summary>
        /// <param name="SubscriberId"></param>
        /// <returns></returns>
        public static string TopicQuestions()
        {
            return RedisPrefix + "TopicQuestions" + "_" ;
        }

        public static string Access_Token = RedisPrefix + "Access_Token";
    }
}
